package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.EmergencyTrainingMapper;
import com.ruoyi.yanjing.domain.EmergencyTraining;
import com.ruoyi.yanjing.service.IEmergencyTrainingService;

/**
 * 应急演练Service业务层处理
 * 
 * @author whz
 * @date 2024-12-06
 */
@Service
public class EmergencyTrainingServiceImpl implements IEmergencyTrainingService 
{
    @Autowired
    private EmergencyTrainingMapper emergencyTrainingMapper;

    /**
     * 查询应急演练
     * 
     * @param id 应急演练主键
     * @return 应急演练
     */
    @Override
    public EmergencyTraining selectEmergencyTrainingById(Long id)
    {
        return emergencyTrainingMapper.selectEmergencyTrainingById(id);
    }

    /**
     * 查询应急演练列表
     * 
     * @param emergencyTraining 应急演练
     * @return 应急演练
     */
    @Override
    public List<EmergencyTraining> selectEmergencyTrainingList(EmergencyTraining emergencyTraining)
    {
        return emergencyTrainingMapper.selectEmergencyTrainingList(emergencyTraining);
    }

    /**
     * 新增应急演练
     * 
     * @param emergencyTraining 应急演练
     * @return 结果
     */
    @Override
    public int insertEmergencyTraining(EmergencyTraining emergencyTraining)
    {
        emergencyTraining.setCreateTime(DateUtils.getNowDate());
        return emergencyTrainingMapper.insertEmergencyTraining(emergencyTraining);
    }

    /**
     * 修改应急演练
     * 
     * @param emergencyTraining 应急演练
     * @return 结果
     */
    @Override
    public int updateEmergencyTraining(EmergencyTraining emergencyTraining)
    {
        emergencyTraining.setUpdateTime(DateUtils.getNowDate());
        return emergencyTrainingMapper.updateEmergencyTraining(emergencyTraining);
    }

    /**
     * 批量删除应急演练
     * 
     * @param ids 需要删除的应急演练主键
     * @return 结果
     */
    @Override
    public int deleteEmergencyTrainingByIds(Long[] ids)
    {
        return emergencyTrainingMapper.deleteEmergencyTrainingByIds(ids);
    }

    /**
     * 删除应急演练信息
     * 
     * @param id 应急演练主键
     * @return 结果
     */
    @Override
    public int deleteEmergencyTrainingById(Long id)
    {
        return emergencyTrainingMapper.deleteEmergencyTrainingById(id);
    }
}
